#pragma once

#include <vex/functional/make_intrusive_delegate.h>
#include <vex/functional/any_delegate.h>

namespace vex { namespace functional {

    template<class TSignature, class TFunction>
    auto make_any_delegate(TFunction&& p_func)
        -> any_delegate<TSignature>
    {
        return any_delegate<TSignature>(
            make_intrusive_delegate<TSignature>(std::forward<TFunction>(p_func)));
    }

    template<class TSignature>
    auto make_any_delegate(contract::delegate<TSignature>* p_delegate)
        -> any_delegate<TSignature>
    {
        return vex::as_any_from_input() | p_delegate;
    }
}}
